#include "Vector4.h"

Vector2::Vector2() {_X = 0; _Y = 0;}
Vector2::Vector2(float x, float y) {_X = x; _Y = y;}

float Vector2::getX() {return _X;}
float Vector2::getY() {return _Y;}
float & Vector2::operator[](int i) 
{
	if(i == 0)
		return _X;
	else if(i == 1)
		return _Y;
	assert(false);
	return _X;
}

Vector3::Vector3() : Vector2() {_Z = 0;}
Vector3::Vector3(float x, float y, float z) : Vector2(x,y) {_Z = z;}

float Vector3::getZ() {return _Z;}
float & Vector3::operator[](int i)
{
	if(i == 2)
		return _Z;
	return Vector2::operator[](i);
}


Vector4::Vector4() : Vector3() { _W = 0; }
Vector4::Vector4(float x, float y, float z, float w) : Vector3(x,y,z) { _W = w; }
float Vector4::getW() {return _W;}
float & Vector4::operator[](int i)
{
	if(i == 3)
		return _W;
	return Vector3::operator[](i);
}
